<!DOCTYPE html>
<html data-dpr="1" style="font-size: 54px;">

<head>
    {include file="common/meta2" /}

    {include file="common/meta3" /}

    <script language="javaScript">

        function isNumber(obj) {
            return !isNaN(parseFloat(obj)) && isFinite(obj);
        }
        function isPhoneNumber(tel) {
            var reg = /^0?1[3|4|5|6|7|8|9][0-9]\d{8}$/;
            return reg.test(tel);
        }
        function settime(num) {
            var yzm_input = document.getElementById("yzm");
            var num;
            if (num == 0) {
                yzm_input.value = "重新发送";
                yzm_input.removeAttribute("disabled");
                yzm_input.setAttribute("class", "reg_yzminput");
                num = 60;
                return false;
            } else {
                yzm_input.setAttribute("disabled", "disabled");
                yzm_input.setAttribute("class", "reg_yzminput reg_disable")
                yzm_input.value = num + "s后重发";
                num--;
            }
            setTimeout("settime(" + num + ")", 1000);
        }
        $(function () {

            $('.login_btn').click(function () {

                var mobile = $('#login_phone').val();
                var password = $("#login_pass").val();
                if (mobile == '') {
                    layer.msg('手机号不能为空');
                    return;
                }
                if (!isPhoneNumber(mobile)) {
                    layer.msg('手机号格式不正确');
                    return;
                }
                if (password == '') {
                    layer.msg('密码不能为空');
                    return;
                }
                $.post("/index/user/login", { mobile: mobile, password: password }, function (ret) {

                    if (ret.code == 1) {
                        layer.msg(ret.msg, { icon: 1, time: 1000 }, function () {
                            localStorage.setItem('u_access', ret.u_access);
                            window.location.href = "/index/user/index";
                        });
                    } else {
                        layer.msg(ret.msg);
                    }

                }, 'json');

            });

        });
    </script>
</head>

<body class="jui_bg_fff" style="font-size: 12px;">
    <!-- 头部 -->
    <div class="jui_top_bar">
        <a class="jui_top_left" href="javascript:history.back(-1)"><img class="jui_none"
                src="/assets/img2/back_111.png"></a>
        <div class="jui_top_middle">登录</div>
    </div>
    <!-- 头部end -->
    <!-- 主体 -->
    <div class="login_bar">
        <div class="jui_flex_col_center logo"><img src="/assets/img2/202410071728286926079.png" alt="轻创优选"></div>
        <div class="jui_public_list jui_flex_justify_between">
            <div class="jui_flex1">
                <span class="iconfont jui_fs20 jui_pad_r12 jui_fc_999 jui_flex_no"></span>
                <input class="jui_flex1" style="max-width:4.5rem;" type="text" placeholder="手机号" id="login_phone">
            </div>
        </div>
        <div class="jui_h12"></div>
        <div class="jui_public_list">
            <span class="iconfont jui_fs20 jui_pad_r12 jui_fc_999"></span>
            <input class="flex1" type="password" value="" placeholder="登录密码" id="login_pass">
        </div>
        <div class="jui_h20"></div>
        <div class="jui_public_btn login_btn"><input type="button" value="立即登录"></div>
        <div class="jui_flex jui_flex_justify_between jui_pad_t16">
            <a href="/index/user/register" class="jui_block jui_fs12">没有帐号？注册一个帐号</a>
        </div>
    </div>

    <!-- 主体end -->


</body>

</html>